<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "DTD/xhtml1-strict.dtd">
<html>
  <head>
    <title>API docs for &ldquo;pymine.api.models.Item&rdquo;</title>
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
    <link href="apidocs.css" type="text/css" rel="stylesheet" />
    
    
  </head>
  <body>
    <h1 class="class">Class p.a.m.Item(<a href="pymine.api.models.AbstractThing.html">AbstractThing</a>):</h1>
    <p>
      <span id="part">Part of <a href="pymine.html">pymine</a>.<a href="pymine.api.html">api</a>.<a href="pymine.api.models.html">models</a></span>
      
      <a href="classIndex.html#pymine.api.models.Item">View In Hierarchy</a>
    </p>
    <div>
      
    </div>
    <div class="undocumented">No class docstring</div>
    
    
    <div id="splitTables">
      <table class="children sortable" id="id35">
  
  
  
  
  <tr class="class">
    
    
    <td>Class</td>
    <td><a href="pymine.api.models.Item.Meta.html">Meta</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="classmethod">
    
    
    <td>Class Method</td>
    <td><a href="pymine.api.models.Item.html#create">create</a></td>
    <td><span>Create one or more new Items() from a HTTPRequest, overriding</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#save">save</a></td>
    <td><span>override save method to perform sanity checks</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#save_files_from">save_files_from</a></td>
    <td><span>save per-item files for this instance</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#get_data_size">get_data_size</a></td>
    <td><span>returns the size of the data file; if there is no file,</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#get_data_type">get_data_type</a></td>
    <td><span>if there is a declared item.type, it is returned;</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#get_icon_size">get_icon_size</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#get_icon_type">get_icon_type</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#to_structure">to_structure</a></td>
    <td><span class="undocumented">Undocumented</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#feed_description">feed_description</a></td>
    <td><span>if there is a data file, the description *is* HTML and is</span></td>
  </tr><tr class="method">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.Item.html#to_feedxml">to_feedxml</a></td>
    <td><span>Creates the structure used in FEEDXML generation</span></td>
  </tr>
  
</table>
      
        <p>
          Inherited from <a href="pymine.api.models.AbstractThing.html">AbstractThing</a>:
        </p>
        <table class="children sortable" id="id36">
  
  
  
  
  <tr class="baseclassmethod">
    
    
    <td>Class Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#get">get</a></td>
    <td><span>return a single model matching kwargs; expunge virtually-deleted ones; 
if none return None; if multiple, throw exception</span></td>
  </tr><tr class="baseclassmethod">
    
    
    <td>Class Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#list">list</a></td>
    <td><span>return a queryset of models matching kwargs; expunge virtually-deleted 
ones</span></td>
  </tr><tr class="baseclassmethod">
    
    
    <td>Class Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#execute_search_query">execute_search_query</a></td>
    <td><span>take one queryset and return another, filtered by the content of 
search_string; this version is a no-op</span></td>
  </tr><tr class="baseclassmethod">
    
    
    <td>Class Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#search">search</a></td>
    <td><span>return a queryset of models matching **kwargs and search_string; expunge
virtually-deleted ones</span></td>
  </tr><tr class="basemethod">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#update">update</a></td>
    <td><span>update a single Thing from a HTTPRequest, overriding with values from 
kwargs</span></td>
  </tr><tr class="basemethod">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#delete">delete</a></td>
    <td><span>gc all the fields and mark this Thing as deleted</span></td>
  </tr><tr class="basemethod">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#get_absolute_url">get_absolute_url</a></td>
    <td><span>return a url for this object for administrative purposes</span></td>
  </tr><tr class="basemethod">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#delete_attribute">delete_attribute</a></td>
    <td><span>erase the value of attribute 'key' (or delete extended attribute 
'$key')</span></td>
  </tr><tr class="basemethod">
    
    
    <td>Method</td>
    <td><a href="pymine.api.models.AbstractThing.html#__unicode__">__unicode__</a></td>
    <td><span>return the canonical name of this object</span></td>
  </tr>
  
</table>
      
      
    </div>
    
    
    
    <div class="function">
        <a name="pymine.api.models.Item.create"></a>
        <a name="create"></a>
        <div class="functionHeader">
        @classmethod<br />
        def create(klass, request=None, **kwargs):
        
      </div>
        <div class="functionBody">
          <div class="interfaceinfo">overrides <a href="pymine.api.models.AbstractThing.html#create">pymine.api.models.AbstractThing.create</a></div>
          <div>Create one or more new Items() from a HTTPRequest, overriding with 
values from kwargs</p>
<p>Assuming nothing goes wrong, one Item() will be created per 
&quot;itemData&quot; file submitted in the multipart POST request; they 
will all have the same iconData, etc, if specified.</p>
<p>If no &quot;data&quot; file is submitted, only a single non-data Item 
will result.</p>
<p>The result for a single Item() creation will be a single Item().</p>
<p>The result for multiple Item() creation will be a list of multiple 
Items() a-la &quot;list_items()&quot;</p>
<p>For Item() creation via the API, all this will be made plain via the 
envelope metadata.</p>
<p>kwargs is used as a backchannel to Item.save_files_from() to tell it 
which file needs saving; thus is it important that Thing.update pass that 
data onwards.<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.save"></a>
        <a name="save"></a>
        <div class="functionHeader">
        
        def save(self):
        
      </div>
        <div class="functionBody">
          
          <div>override save method to perform sanity checks<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.save_files_from"></a>
        <a name="save_files_from"></a>
        <div class="functionHeader">
        
        def save_files_from(self, request, **kwargs):
        
      </div>
        <div class="functionBody">
          <div class="interfaceinfo">overrides <a href="pymine.api.models.AbstractThing.html#save_files_from">pymine.api.models.AbstractThing.save_files_from</a></div>
          <div>save per-item files for this instance</p>
<p>rules for content type:</p>
<p>if you declare itemDataType/itemIconType, it wins</p>
<p>if you do not declare itemDataType/itemIconType, but the browser 
supplies a multipart-encoding type other than 'application/octet-stream', 
then that wins.</p>
<p>otherwise the mimetypes module takes a guess</p>
<p>if all else fails, it ends up as application/octet-stream<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.get_data_size"></a>
        <a name="get_data_size"></a>
        <div class="functionHeader">
        
        def get_data_size(self):
        
      </div>
        <div class="functionBody">
          
          <div>returns the size of the data file; if there is no file, returns the size
of self.description, or zero<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.get_data_type"></a>
        <a name="get_data_type"></a>
        <div class="functionHeader">
        
        def get_data_type(self):
        
      </div>
        <div class="functionBody">
          
          <div>if there is a declared item.type, it is returned; else if there is a 
data file, return 'application/octet-stream'; else return 'text/html' and 
assume the description is HTML<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.get_icon_size"></a>
        <a name="get_icon_size"></a>
        <div class="functionHeader">
        
        def get_icon_size(self):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.get_icon_type"></a>
        <a name="get_icon_type"></a>
        <div class="functionHeader">
        
        def get_icon_type(self):
        
      </div>
        <div class="functionBody">
          
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.to_structure"></a>
        <a name="to_structure"></a>
        <div class="functionHeader">
        
        def to_structure(self, request=None):
        
      </div>
        <div class="functionBody">
          <div class="interfaceinfo">overrides <a href="pymine.api.models.AbstractThing.html#to_structure">pymine.api.models.AbstractThing.to_structure</a></div>
          <div class="undocumented">Undocumented</div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.feed_description"></a>
        <a name="feed_description"></a>
        <div class="functionHeader">
        
        def feed_description(self):
        
      </div>
        <div class="functionBody">
          
          <div>if there is a data file, the description *is* HTML and is returned, else
if self.item_type() suggests HTML, the description is returned, else a 
hardcoded default is returned<table class="fieldTable"></table></div>
        </div>
      </div><div class="function">
        <a name="pymine.api.models.Item.to_feedxml"></a>
        <a name="to_feedxml"></a>
        <div class="functionHeader">
        
        def to_feedxml(self, feedmk):
        
      </div>
        <div class="functionBody">
          
          <div>Creates the structure used in FEEDXML generation</p>
<p>See 
http://docs.djangoproject.com/en/dev/ref/contrib/syndication/#django.contrib.syndication.SyndicationFeed.add_item
and feedgen.py<table class="fieldTable"></table></div>
        </div>
      </div>
    
    <address>
      <a href="index.html">API Documentation</a> for pymine, generated by <a href="http://codespeak.net/~mwh/pydoctor/">pydoctor</a> at 2010-04-07 23:15:24.
    </address>
  </body>
</html>